package com.study.prototype.deep;

import java.util.ArrayList;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        ConcretePrototype prototype = new ConcretePrototype();
        prototype.setName("tom");
        prototype.setAge(18);
        List<String> hobbies = new ArrayList<String>();
        hobbies.add("音乐");
        hobbies.add("美术");
        prototype.setHobbies(hobbies);

        ConcretePrototype clone = prototype.deepClone();
        clone.getHobbies().add("看电影");
        System.out.println(prototype);
        System.out.println(clone);

        System.out.println(prototype == clone);
        System.out.println(prototype.getHobbies() == clone.getHobbies());
    }
}
